package com.xzc.refactory.data.replaceDataValueWithObject.t1;

import java.util.Collection;
import java.util.Iterator;

public class OrderApp {

    public static int numberOfOrdersFor(Collection<Order> orders, String customer) {
        int result = 0;
        Iterator<Order> iter = orders.iterator();
        while (iter.hasNext()) {
            Order each = iter.next();
            if (each.get_customer().equals(customer))
                result++;
        }
        return result;
    }
}
